﻿// ------------------------------------------------------------------------------------------------
// <copyright file="CrmSolution.cs" company="Hiyoko">
//   Copyright (c) 2015 All Rights Reserved
// </copyright>
// <summary>
//   This Model class represents a Dynamics CRM solution.
// </summary>
// ---------------------------------------------------------------------------------------------

using System;
using System.Text;

namespace Hiyoko.SolutionsComparer.Model
{
    public class CrmSolution
    {
        #region Properties

        /// <summary>
        /// The solution unique identifier.
        /// </summary>
        public Guid SolutionId { get; set; }

        /// <summary>
        /// The solution unique name.
        /// </summary>
        public string UniqueName { get; set; }

        /// <summary>
        /// The solution friendly name.
        /// </summary>
        public string FriendlyName { get; set; }

        /// <summary>
        /// The solution version.
        /// </summary>
        public string Version { get; set; }

        /// <summary>
        /// The solution installation date.
        /// </summary>
        public DateTime InstalledOn { get; set; }

        /// <summary>
        /// The solution publisher's name.
        /// </summary>
        public string Publisher { get; set; }

        /// <summary>
        /// The solution description.
        /// </summary>
        public string Description { get; set; }

        #endregion Properties

        #region Public methods

        /// <summary>
        /// Override ToString() method for CrmSolution instance.
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            var builder = new StringBuilder();

            builder.AppendLine(string.Format("Unique Identifier: {0}", SolutionId));
            builder.AppendLine(string.Format("Unique Name: {0}", UniqueName));
            builder.AppendLine(string.Format("Friendly Name: {0}", FriendlyName));
            builder.AppendLine(string.Format("Version: {0}", Version));
            builder.AppendLine(string.Format("Installed On: {0}", InstalledOn));
            builder.AppendLine(string.Format("Publisher: {0}", Publisher));

            return builder.ToString();
        }

        #endregion Public methods
    }
}
